var Fight,
  __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (i, o) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, i) {
              t.__proto__ = i;
            }) ||
          function (t, i) {
            for (var o in i)
              Object.prototype.hasOwnProperty.call(i, o) && (t[o] = i[o]);
          })(i, o);
      };
      return function (i, o) {
        function a() {
          this.constructor = i;
        }
        if ("function" != typeof o && null !== o)
          throw new TypeError(
            "Class extends value " + String(o) + " is not a constructor or null"
          );
        t(i, o),
          (i.prototype =
            null === o
              ? Object.create(o)
              : ((a.prototype = o.prototype), new a()));
      };
    })();
!(function (t) {
  var i = (function (t) {
    function i() {
      var i = t.call(this) || this;
      return (
        (i.isUsed = !1),
        (i.body = new Laya.Animation()),
        (i.body.scaleX = 1),
        (i.body.scaleY = 1),
        i.addChild(i.body),
        i
      );
    }
    return (
      __extends(i, t),
      (i.prototype.onLoad = function (t) {
        (i.isLoading[t] = !1),
          i.isCache[t] ||
            (Laya.Animation.createFrames(this.magicUrls(t), "magic" + t),
            (i.isCache[t] = !0));
      }),
      (i.prototype.load = function (t) {
        if (!i.isLoading[t]) {
          i.isLoading[t] = !0;
          var o = i.path + t + ".atlas";
          Laya.loader.load(
            o,
            Laya.Handler.create(this, this.onLoad, [t]),
            null,
            Laya.Loader.ATLAS
          );
        }
      }),
      (i.prototype.payAction = function (t) {
        this.body.play(0, !1, "magic" + t);
        var i = this.getBounds();
        this.body.pos(-i.width / 2, -(i.height / 2 + 15));
      }),
      (i.prototype.magicUrls = function (t) {
        for (
          var i = t.split("-"), o = 1 * parseInt(i[1]), a = [], n = 1;
          n <= o;
          n++
        )
          a.push("comp/magic/" + t + "/" + n + ".png");
        return a;
      }),
      (i.prototype.loadSkill = function (t) {
        var i;
        t.skill_1 > 0 && ((i = Dictionary.skill[t.skill_1]), this.load(i.ani)),
          t.skill_2 > 0 &&
            ((i = Dictionary.skill[t.skill_2]), this.load(i.ani)),
          t.skill_3 > 0 &&
            ((i = Dictionary.skill[t.skill_3]), this.load(i.ani)),
          t.skill_4 > 0 &&
            ((i = Dictionary.skill[t.skill_4]), this.load(i.ani));
      }),
      (i.prototype.paySkill = function (t) {
        var i = Dictionary.skill[t];
        this.payAction(i.ani);
      }),
      (i.path = "res/atlas/comp/magic/"),
      (i.isCache = {}),
      (i.isLoading = {}),
      i
    );
  })(Laya.Sprite);
  t.Magic = i;
})(Fight || (Fight = {}));
